package com.ex.shapecalc;

import com.ex.question.base.ShapeQuestion;

public class RectangleQuestion extends ShapeQuestion {
	int mLength;
	int mWidth;
	
	public RectangleQuestion(){
		mQuestionTypeName = "长方形面积计算";
	   createQuestion();	
	}
	
	public RectangleQuestion(int l, int w){
		mQuestionTypeName = "长方形面积计算";
		createQuestion(l, w);	
	}
	
	@Override
	public void CalcArea()
	{
		mArea = mLength * mWidth;		
	}
	
	@Override
	public void CalcPerimeter()
	{
		mPerimeter = 2 * (mLength + mWidth);
	}
 
public void createQuestion( ) { 
	createQuestion(mRand.getRandom10(),
			mRand.getRandom10());
	} 
	public void createQuestion(int l, int w) { 
		mLength = l;
		mWidth = w;
		CalcArea();
		CalcPerimeter();	
	} 
}
